package com.devbobcorn.donutopia.client.event.rendering;

import com.devbobcorn.donutopia.Donutopia;
import com.devbobcorn.donutopia.entities.ChoxEntity;

import net.minecraft.client.renderer.entity.EntityRendererManager;
import net.minecraft.client.renderer.entity.FoxRenderer;
import net.minecraft.entity.passive.FoxEntity;
import net.minecraft.util.ResourceLocation;

public class ChoxRenderer extends FoxRenderer{
    public ChoxRenderer(EntityRendererManager manager) {
        super(manager);
    }

    @Override
    public ResourceLocation getTextureLocation(FoxEntity entity) {
        if (entity instanceof ChoxEntity){
            ChoxEntity ce = (ChoxEntity)entity;
            if (ce.getChoxVariantType() == ChoxEntity.Type.DARK)
                return new ResourceLocation(Donutopia.MODID, ce.isSleeping() ? "textures/chox_sleep.png" : "textures/chox.png");
            else return new ResourceLocation(Donutopia.MODID, ce.isSleeping() ? "textures/milky_chox_sleep.png" : "textures/milky_chox.png");
        }
        return new ResourceLocation(Donutopia.MODID, "textures/chox.png");
    }
}
